package com.itic.system.delivery.method.service;

import com.itic.appbase.framework.common.constants.DBConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.itic.appbase.framework.common.service.CrudService;
import com.itic.system.delivery.method.persistence.dao.DeliveryMethodDao;
import com.itic.system.delivery.method.persistence.model.DeliveryMethod;
import com.itic.system.delivery.method.persistence.model.DeliveryMethodExample;
import com.itic.system.delivery.method.persistence.model.DeliveryMethodExample.Criteria;

import java.util.List;


@Service
@Transactional
public class DeliveryMethodService
     extends CrudService<DeliveryMethodDao,DeliveryMethod,DeliveryMethodExample> {
    @Autowired
    private DeliveryMethodDao deliveryMethodDao;

    /**
     * 获取所有的发货类型
     * @return
     */
    public List<DeliveryMethod> findDeliveryMethod(){
        DeliveryMethodExample example = new DeliveryMethodExample();
        Criteria criteria = example.createCriteria();
        criteria.andIsEffectiveEqualTo(DBConst.TRUE);
        example.setOrderByClause(" REORDER desc");
        List<DeliveryMethod> deliveryMethods = this.list(example);
        return deliveryMethods;
    }


}